﻿namespace Sai.Core.Reporting
{
    using System.Collections.Generic;

    /// <summary>
    /// Built in report style repository
    /// </summary>
    public class DefaultStyleRepository : IReportStyleRepository
    {
        private Dictionary<string, IReportStyler> styles = new Dictionary<string, IReportStyler>();

        const string VanillaStyle = "Vanilla";
        const string BlueStyle = "Blue";

        public DefaultStyleRepository()
        {
            this.styles.Add(VanillaStyle, new DefaultReportStyler());
            this.styles.Add(BlueStyle, new ClassicReportStyler());
        }

        public IReportStyler Find(string styleName)
        {
            if (this.styles.ContainsKey(styleName))
                return this.styles[styleName];

            return this.styles[BlueStyle];
        }
    }
}
